-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: tick init/deinit for CL #7622
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The tick initialization cleanup seems like a pretty big driveby change to make but it does seem correct. We should validate that that branch really did nothing
x/concentrated-liquidity/tick.go
Outdated
// set the tick's spread reward growth opposite direction of last traversal to the spread factor accumulator's value | ||
if liquidityBefore.IsZero() { | ||
if tickIndex <= currentTick { | ||
accum, err := k.GetSpreadRewardAccumulator(ctx, poolId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing these reads should change the gas for this function so this is not state compatible right? Since even if this branch didn't do anything the reads were still happening
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I will separate it into a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved here: #7625
446f987
to
082f101
Compare
Will backport and sync a v23.x node |
(cherry picked from commit ea2310a) # Conflicts: # CHANGELOG.md
(cherry picked from commit ea2310a)
(cherry picked from commit ea2310a) Co-authored-by: Roman <[email protected]>
Closes: #XXX
What is the purpose of the change
Adding events for initializing and deinitializing ticks. This is needed by Numia for computing the APRs.
As a drive-by change, I noticed that we recomputed the spread rewards accumulators and removed the duplicate logic.
Testing and Verifying
Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)